<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>频道栏目列表</title>
	<Pintuer />
	<script type="text/javascript">
	// 按钮全选
	window.onload = function(){
		var oSelsctAll = document.getElementById("selectAll");
		var aInput = document.getElementsByTagName("input");
		oSelsctAll.onclick = function(){
			for(var i = 0;i<aInput.length;i++){
				if(aInput[i].checked == true){
					aInput[i].checked = false;
				}else{
					aInput[i].checked = true;
				}
			}
		}
	}

	// checkbox 全选
	function CheckAll(value,obj){
		var form = document.getElementsByTagName("form")
		for(var i=0;i<form.length;i++){
			for (var j=0;j<form[i].elements.length;j++){
				if(form[i].elements[j].type=="checkbox"){
					var e = form[i].elements[j];
					if (value=="selectAll")
						{
							e.checked=obj.checked
						}else{
							e.checked=!e.checked;
						}
				}
			}
		}
	}
</script>
</head>
<body>
	<div class="container-layout">
		<!-- 导航位置 -->
		<div class="text-small text-gray height-big">
			<div class="float-left height">
				<span class="icon-home"></span>
				当前位置： 首页 -> 频道管理 -> 频道栏目列表
			</div>
			<div class="float-right">
				<div class="radius-rounded height">
					<button type="button" onClick="location.href='{?:U('index')?}'" class="button bg">
						<i class="icon-th-list"></i>
						频道列表
					</button>
					<button type="button" onClick="location.href='{?:U('add')?}'" class="button">
						<i class="icon-edit"></i>
						添加频道
					</button>
					<button type="button" onClick="location.href='{?:U('updateCache')?}'" class="button">
						<i class="icon-eraser"></i>
						更新缓存
					</button>
				</div>
			</div>
			<div class="clearfix"></div>
		</div>
		<hr />
		<!-- 导航位置 End -->
	<form action="{?:U('updateOrder')?}" method="POST">
		<table class="table table-bordered table-hover table-condensed table-responsive">
			<tr class="bg">
				<td width="80" align="center">
					<input onclick=CheckAll('selectAll',this) type="checkbox" value="on" name="chkall" />
				</td>
				<td width="80">cid</td>
				<td width="80">排序</td>
				<td>频道名称</td>
				<td>类型</td>
				<td>操作</td>
			</tr>
			<volist name="cate" id="vo">
				<tr>
					<td align="center">
						<label><input type="checkbox" id="id" name="cid[]" value="{?$vo.cid?}"/></label>
					</td>
					<td>{?$vo.cid?}</td>
					<td><input type="text" value="{?$vo.catorder?}" class="input input-small" name="list_order[{?$vo.cid?}]"/></td>
					<td>
						<if condition="$vo['pid'] eq 0">
							<strong>{?$vo._name?}</strong>
							<else />
							{?$vo._name?}
						</if>
					</td>
					<td>{?$vo.cat_type_name?}</td>
					<td width="300">
						<a href="{?:U('Home/Cate/index',array('cid'=>$vo['cid']))?}" target="_blank">
							访问
						</a>
						<span>|</span>
						<a href="{?:U('add',array('pid'=> $vo['cid']))?}">
							添加子栏目
						</a>
		                <span>|</span>
		                <a href="{?:U('edit',array('cid'=>$vo['cid']))?}">
		                	<i class="icon-edit"></i>
		                    修改
		                </a>
		                <span>|</span>
		                <a href="javascript:;" class="dialogs" data-toggle="click" data-target="#mydialog{?$vo.cid?}" data-mask="1" data-width="20%">
		                	<i class="icon-trash-o"></i>
		                    删除
		                </a>
		                <!-- 删除确认框 Start -->
						<div id="mydialog{?$vo.cid?}">
							<div class="dialog radius-none bouncein">
								<div class="dialog-head">
									<span class="close icon-times"></span>
									<strong>删除确认对话框</strong>
								</div>
								<div class="dialog-body">
									是否确认删除该频道？
								</div>
								<div class="dialog-foot">
									<button class="button radius-none bg-sub" onClick="location.href='{?:U('del',array('cid'=>$vo['cid']))?}'">
										<i class="icon-check-square-o radius-none"></i>
										确 认
									</button>
									<button class="button radius-none dialog-close">
										<i class="icon-times"></i>
										取 消
									</button>
								</div>
							</div>
						</div>
						<!-- 删除确认框 End -->
					</td>
				</tr>
			</volist>
			<tr>
				<td colspan="7">
					<button type="button" id="selectAll" class="button bg border">
						<i class="icon-arrows"></i>
						全 选
					</button>
					<button type="submit" class="button bg border">
						<i class="icon-arrows-v"></i>
						排 序
					</button>
				</td>
			</tr>
		</table>
	</form>
</div>
</body>
</html>